package com.ygsoft.activiti.model;

import org.activiti.engine.history.HistoricProcessInstance;
import org.activiti.engine.history.HistoricTaskInstance;

import java.util.Date;

/**
 * 我的已办任务
 *
 * @author zhx
 * @create 2017-11-28 16:18
 **/
public class MyCompleteTask {

    private String taskId;

    private String taskName;

    private String comment;

    private String bussinessId;

    private String businessKey;

    private String businessStatus;

    private Date time;


    public MyCompleteTask(CompleteTask completeTask,HistoricTaskInstance historicTaskInstance,HistoricProcessInstance historicProcessInstance) {
        this.taskId = completeTask.getTaskId();
        this.comment = completeTask.getMessage();
        this.taskName = historicTaskInstance.getName();
        this.bussinessId = historicProcessInstance.getBusinessKey();
        this.businessKey = historicProcessInstance.getProcessDefinitionKey();
        this.time = completeTask.getTime();

        if (historicProcessInstance.getEndTime()!= null){
            this.businessStatus = "已结束";
        }else{
            this.businessStatus = "流转中";
        }
    }

    public Date getTime() {
        return time;
    }

    public void setTime(Date time) {
        this.time = time;
    }

    public String getTaskId() {
        return taskId;
    }

    public void setTaskId(String taskId) {
        this.taskId = taskId;
    }

    public String getTaskName() {
        return taskName;
    }

    public void setTaskName(String taskName) {
        this.taskName = taskName;
    }

    public String getComment() {
        return comment;
    }

    public void setComment(String comment) {
        this.comment = comment;
    }

    public String getBussinessId() {
        return bussinessId;
    }

    public void setBussinessId(String bussinessId) {
        this.bussinessId = bussinessId;
    }

    public String getBusinessKey() {
        return businessKey;
    }

    public void setBusinessKey(String businessKey) {
        this.businessKey = businessKey;
    }
}
